<?php

namespace App\Http\Requests\Dashboard;

use Illuminate\Foundation\Http\FormRequest;

class UserIndexRequest extends FormRequest
{
    /**
     * Determine if the user is authorized to make this request.
     *
     * @return bool
     */
    public function authorize()
    {
        return true;
    }

    /**
     * Get the validation rules that apply to the request.
     *
     * @return array
     */
    public function rules()
    {
        return [
            [
                'page' => ['numeric', 'min:1'],
                'per_page' => ['numeric', 'min:2', 'max:100'],
                'name' => ['string'],
                'email' => ['string'],
                'roles' => ['array'],
                'order_by' => ['in:created_at,updated_at'],
                'order_direction' => ['in:desc,asc'],
                'created_at_from' => ['date'],
                'created_at_to' => ['date'],
                'trashed_type' => ['in:1,2,3'],
            ],
        ];
    }
}
